﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UsersMaster.master" AutoEventWireup="true"
    CodeBehind="ItemSearch.aspx.cs" Inherits="SMS.Items.ItemSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="UserHeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="UserMainContent" runat="server">
    <div id="search" class="boxed">
        <h2 class="title" dir="rtl">
            <img src="../App_Themes/Theme/images/Search 2.png" class="img" />
            البحــث عـن بضــاعة</h2>
        <div class="content" dir="rtl">
            <table>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="Barcode :" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtBarCode" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="Part Number:" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtPartNumber" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="Name :" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtName" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="Mark :" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtMark" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button runat="server" ID="btnSearch" Text="Search" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView runat="server" ID="gvItems" CssClass="Grid" AllowPaging="true" AllowSorting="true"
                AutoGenerateColumns="false" DataKeyNames="ID" OnPageIndexChanging="gvItems_PageIndexChanging"
                OnRowEditing="gvItems_RowEditing">
                <Columns>
                    <asp:BoundField DataField="Name" HeaderText="Name" />
                    <asp:BoundField DataField="Mark" HeaderText="Mark" />
                    <asp:BoundField DataField="SellingPrice" HeaderText="Selling Price" />
                    <asp:TemplateField HeaderText="Stocks">
                        <ItemTemplate>
                            <asp:Repeater runat="server" ID="rptrStocks" DataSource='<%# DataBinder.Eval(Container.DataItem,"StockItems") %>'>
                                <ItemTemplate>
                                    (<asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Count") %>'
                                        Font-Underline="true" />) (
                                    <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Stock.Name") %>'
                                        Font-Underline="true" />)
                                    <asp:LinkButton runat="server" CommandName="edit"  />
                                    <br />
                                </ItemTemplate>
                            </asp:Repeater>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Edit">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" Text="Edit" CommandName="edit" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    No Result Found
                </EmptyDataTemplate>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
